#include "TK.h"

int main(int argc,char* argv[]){
	if(argc<2)
	{
		printf("usage: Queue_size data1 data2 data3 ... \n	(The quantity of data had better transcend the Queue_size.)\n");
		return 0;
	}
	struct Queue* Q;
	int Queue_size = *argv[1]-48;
	char val;
	Q_init(Q);

	for(int i=2;i<=4&&i<argc;i++)
	{
		printf("%c %d\n",*argv[i],Queue_size);
		if(!enqueue(Q,*argv[i],Queue_size))
		printf("The Q is full!\n");
		else
		printf("sucess enqueue!\n");
	}

	for(int i=0;i<4;i++)
	{
		if(!dequeue(Q,&val))
		printf("The Q is empty!\n");
		else
		printf("Dequeue clearance! The char extracted is %c.\n",val);
	}

		for(int i=2;i<argc;i++)
	{
		printf("%c %d\n",*argv[i],Queue_size);
		if(!enqueue(Q,*argv[i],Queue_size))
		printf("The Q is full!\n");
		else
		printf("sucess enqueue!\n");
	}

	for(int i=0;i<Queue_size;i++)
	{
		if(!dequeue(Q,&val))
		printf("The Q is empty!\n");
		else
		printf("Dequeue clearance! The char extracted is %c.\n",val);
	}
	destroy(Q);
	return 0;	
}
